﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/OneColumn.Master" AutoEventWireup="true"
    CodeBehind="Event.aspx.cs" Inherits="SharingCenter.Web.Mod.Groups.Events.Event" ValidateRequest="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
    TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    发起活动
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/User/Events/EventFunc.js" />
        </Scripts>
    </asp:ScriptManagerProxy>
    
    <myuc:GenericTabs ID="LinkListTabs2" runat="server" Section="GroupPage" SelectedItem="event" AddPageQueryString="true" />
    <h2 class="bb">
        发起活动</h2>
    <div class="left wide-c">
    
    <div>
        <asp:FormView ID="FormView1" runat="server" DefaultMode="Insert" DataKeyNames="EventId"
            DataSourceID="LinqDataSource1" Width="100%">
            <InsertItemTemplate>
                <div class="formtable">
                    <fieldset class="ctn1">
                        <legend>主题与报名 </legend>
                        <table cellspacing="0">
                            <tr>
                                <td class="labelcell labelgroup">
                                    活动主题:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="活动主题必须填写。"
                                        SetFocusOnError="true" ControlToValidate="TitleTextBox" Display="None" />
                                    <cc:CustomValidatorCallOut ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    活动类型:
                                </td>
                                <td>
                                    <cc:XmlDropDownList runat="server" XmlPath="~/App_Data/ActivityCategories.xml" ID="XmlDropDownList1"
                                        SelectedValue='<%# Bind("Category") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell" valign="top">
                                    活动时间:
                                </td>
                                <td valign="top">
                                    <div class="ctn-p-b">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="必须选择开始日期。"
                                            SetFocusOnError="true" ControlToValidate="txtStartDate" Display="None" />
                                        <%--<cc:CustomValidatorCallOut ID="CustomValidatorCallOut1" runat="server" TargetControlID="RequiredFieldValidator2"
                                            PopupPosition="Left" />
                                        <asp:CustomValidator ControlToValidate="txtStartDate" ClientValidationFunction="CheckStartDate"
                                            SetFocusOnError="true" Display="None" ID="CustomValidator3" runat="server" ErrorMessage="活动开始时间不能早于现在。" />
                                        <cc:CustomValidatorCallOut ID="CustomValidatorCallOut6" runat="server" TargetControlID="CustomValidator3"
                                            PopupPosition="Left" />
                                        <ajaxctrltool:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
                                            TargetControlID="txtStartDate" Enabled="false" WatermarkCssClass="tb-m  textboxwatermark" WatermarkText="开始日期">
                                        </ajaxctrltool:TextBoxWatermarkExtender>
                                        <ajaxctrltool:CalendarExtender Enabled="false" ID="CalendarExtender1" runat="server" TargetControlID="txtStartDate">
                                        </ajaxctrltool:CalendarExtender>--%>
                                        <asp:TextBox ID="txtStartDate" runat="server" CssClass="tb-m startdate datepicker"></asp:TextBox>
                                        <cc:NumericDropDownList CssClass="starthour" ID="nddStartHours" runat="server" LowerBound="0"
                                            UpperBound="23" IsYearList="false" />
                                        <span>点</span>
                                        <cc:NumericDropDownList CssClass="startmin" ID="nddStartMins" runat="server" LowerBound="0"
                                            UpperBound="59" IsYearList="false" />
                                        <span>分 至</span>
                                    </div>
                                    <div>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="必须选择结束日期。"
                                            SetFocusOnError="true" ControlToValidate="txtEndDate" Display="None" />
                                        <%--<cc:CustomValidatorCallOut ID="CustomValidatorCallOut2" runat="server" TargetControlID="RequiredFieldValidator3"
                                            PopupPosition="Left" />
                                        <ajaxctrltool:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" runat="server"
                                            TargetControlID="txtEndDate" WatermarkCssClass="tb-m  textboxwatermark" WatermarkText="结束日期">
                                        </ajaxctrltool:TextBoxWatermarkExtender>
                                        <ajaxctrltool:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtEndDate">
                                        </ajaxctrltool:CalendarExtender>--%>
                                        <asp:TextBox ID="txtEndDate" runat="server" CssClass="tb-m  enddate"></asp:TextBox>
                                        <cc:NumericDropDownList CssClass="endhour" ID="nddEndHours" runat="server" LowerBound="0"
                                            UpperBound="23" IsYearList="false" />
                                        <span>点</span>
                                        <cc:NumericDropDownList CssClass="endmin" ID="nddEndMins" runat="server" LowerBound="0"
                                            UpperBound="59" IsYearList="false" />
                                        <span>分</span>
                                        <asp:CustomValidator ControlToValidate="txtEndDate" ClientValidationFunction="CheckActivityDates"
                                            SetFocusOnError="true" Display="None" ID="CustomValidator1" runat="server" ErrorMessage="结束时间不能早于开始时间。" />
                                        <cc:CustomValidatorCallOut ID="CustomValidatorCallOut3" runat="server" TargetControlID="CustomValidator1"
                                            PopupPosition="Left" />
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    报名截至:
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="必须选择报名截止时间。"
                                        SetFocusOnError="true" ControlToValidate="txtSignUpCloseDate" Display="None" />
                                   <%-- <cc:CustomValidatorCallOut ID="CustomValidatorCallOut5" runat="server" TargetControlID="RequiredFieldValidator4"
                                        PopupPosition="Left" />
                                    <ajaxctrltool:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender3" runat="server"
                                        TargetControlID="txtSignUpCloseDate" WatermarkCssClass="tb-m  textboxwatermark"
                                        WatermarkText="报名截止日">
                                    </ajaxctrltool:TextBoxWatermarkExtender>
                                    <ajaxctrltool:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtSignUpCloseDate">
                                    </ajaxctrltool:CalendarExtender>--%>
                                    <asp:TextBox ID="txtSignUpCloseDate" runat="server" CssClass="tb-m offdate datepicker"></asp:TextBox>
                                    <cc:NumericDropDownList ID="nddSignUpCloseHours" CssClass="offhour" runat="server"
                                        LowerBound="0" UpperBound="23" IsYearList="false" />
                                    <span>点</span>
                                    <asp:CustomValidator ControlToValidate="txtSignUpCloseDate" ClientValidationFunction="CheckSignUpDates"
                                        SetFocusOnError="true" Display="None" ID="CustomValidator2" runat="server" ErrorMessage="报名截止时间不能晚于开始时间。" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut4" runat="server" TargetControlID="CustomValidator2"
                                        PopupPosition="Left" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                </td>
                                <td>
                                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#Bind("NeedApproval") %>'
                                        Text="报名需批准" />
                                    &nbsp;&nbsp;
                                    <asp:CheckBox ID="chkCreatorSignUp" runat="server" Checked="true" Text="我自己先报名" />
                                </td>
                            </tr>
                            <%--<tr>
                            <td class="labelcell">我自己先报名:</td>
                            <td >
                                <asp:CheckBox ID="chkCreatorSignUp" runat="server" Checked="true" />
                            </td>
                        </tr>--%>
                            <tr>
                                <td class="labelcell">
                                    人数限制:
                                </td>
                                <td>
                                    <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="必须是小于1000的数字。" Display="None"
                                     ControlToValidate="TextBox1" Type="Integer" MinimumValue="0" MaximumValue="1000"></asp:RangeValidator>
                                     <cc:CustomValidatorCallOut ID="CustomValidatorCallOut9" runat="server"
                                        PopupPosition="Left" TargetControlID="RangeValidator1" />
                                    <asp:TextBox ID="TextBox1" CssClass="tb-s" runat="server" Text='<%# Bind("MaxParticipants") %>'></asp:TextBox>
                                    人（输入0为无限制）
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <fieldset class="ctn1">
                        <legend>地点与费用</legend>
                        <table cellspacing="0">
                            <tr>
                                <td class="labelcell">
                                    所在地区:
                                </td>
                                <td>
                                    <asp:TextBox ID="PlaceTextBox" runat="server" Text='<%# Bind("Place") %>' />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="所在地区必须填写。"
                                        SetFocusOnError="true" ControlToValidate="PlaceTextBox" Display="None" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut7" runat="server" TargetControlID="RequiredFieldValidator5" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    具体地点:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="VenueTextBox" runat="server" Text='<%# Bind("Venue") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    费用说明:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="FeeTextBox" runat="server" Text='<%# Bind("Fee") %>' />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <fieldset class="ctn1">
                        <legend>联系方式</legend>
                        <table cellspacing="0">
                            <tr>
                                <td class="labelcell">
                                    联系人:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="ContactPersonTextBox" runat="server" Text='<%# Bind("ContactPerson") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    联系电话:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="ContactPhoneTextBox" runat="server" Text='<%# Bind("ContactPhone") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelcell">
                                    联系E-mail:
                                </td>
                                <td class="inputgroup">
                                    <asp:TextBox ID="ContactEmailTextBox" runat="server" Text='<%# Bind("ContactEmail") %>' />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <fieldset class="ctn1">
                        <legend>其他信息</legend>
                        <table cellspacing="0">
                            <tr>
                                <td class="labelcell" style="vertical-align: top">
                                    活动介绍:
                                </td>
                                <td class="inputgroup htmleditor">
                                    <myuc:Editor runat="server" EditorType="Simple" ID="Editor1" Height="200" Width="480" Content='<%#Bind("Description") %>'/>
                                    <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="不写一点活动介绍吗？"
                                        ControlToValidate="Editor1" SetFocusOnError="false" Display="None" />
                                    <cc:CustomValidatorCallOut ID="CustomValidatorCallOut8" runat="server" TargetControlID="RequiredFieldValidator6"
                                        PopupPosition="Left" />--%>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </div>
                <div class="actionarea ctn1">
                    <asp:LinkButton ID="btnInsert" CommandName="Insert" runat="server" Text="发起活动" CssClass="submitbutton" />
                </div>
            </InsertItemTemplate>
        </asp:FormView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SharingCenter.Web.Classes.scDataContext"
            EnableInsert="True" TableName="Sc_Events">
            <InsertParameters>
                <asp:ProfileParameter Name="CreatorUserId" PropertyName="UserId" />
                <asp:Parameter Name="TotalParticipants" Type="Int32" DefaultValue="0" />
                <asp:Parameter Name="Pendings" Type="Int32" DefaultValue="0" />
                <asp:Parameter Name="Privacy" Type="Int32" DefaultValue="3" />
                <asp:Parameter Name="EventSource" Type="Int32" DefaultValue="3" />
                <asp:QueryStringParameter Name="EventSourceId" QueryStringField="id" />
            </InsertParameters>
        </asp:LinqDataSource>
    </div>
    </div>
    <div class="wide-s">
    
    </div>
</asp:Content>
